﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using WebKpiPage.Data.Common;

namespace WebKpiPage.Data.BTSXunJian
{
    public static class XunJianDB
    {
        #region 查询_巡检记录信息
        public static DataTable GetXunJianInfoList(int SearchType, string Content)
        {
            SqlConnection conn = ConnMng.GetConnection();
            if (conn == null || conn.State != System.Data.ConnectionState.Open)
            {
                LogSystem.LogInfo("AddGongDanRecord  conn == null || conn.State != System.Data.ConnectionState.Open");
                return null;
            }
            try
            {
                string commandText = "MTNOH_GZ_APP.dbo.mtsp_查询_巡检记录信息";
                int count = 2;
                SqlParameter[] sp = new SqlParameter[count];
                sp[--count] = new SqlParameter("@SearchType", SearchType);
                sp[--count] = new SqlParameter("@Content", Content);
                DataSet ds = SqlHelper.ExecuteDataset(conn, CommandType.StoredProcedure, commandText, sp);
                if (ds != null && ds.Tables.Count > 0)
                {
                    return ds.Tables[0];
                }
                return null;
            }
            catch (Exception e)
            {
                LogSystem.LogError("GetXunJianInfoList", e);
                return null;
            }
            finally
            {
                ConnMng.ReleaseConnection(conn);
            }
        }
        #endregion
    }
}
